package gui_TJCPS;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.layout.Sizes;



/**
 * @author fabio abrantes d
 */
public class PanelNoticiasRss extends JPanel {
	
	private PanelRss panel1;
	private PanelRss panel2;
	private PanelRss panel3;
	public PanelRss[] noticiasRss;
	private CellConstraints cc;
	public PanelNoticiasRss() {
		inicializaComponentes();
	}

	private void inicializaComponentes() {
		
		
		panel2 = new PanelRss();
		panel3 = new PanelRss();
		 cc = new CellConstraints();

		//======== aqui atualiza  PanelNoticiasRss========
		setBackground( Color.BLACK);
		//setBorder(new MatteBorder(4, 4, 4, 4, Color.black));
		setMaximumSize(new Dimension(250, 7593));
		setMinimumSize(new Dimension(250, 7593));
		setPreferredSize(new Dimension(250, 7593));

		
		setLayout(new FormLayout(
			ColumnSpec.decodeSpecs("402dlu"),
			new RowSpec[] {
				new RowSpec(Sizes.dluY(165)),
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC
			}));
		((FormLayout)getLayout()).setRowGroups(new int[][] {{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59}});

		//======== panelRSS ========
		//this.inserirNoticias();
			panel1 = new PanelRss();
			add(panel1, cc.xy(1, 1));

		//======== panel2 ========
		
		add(panel2, cc.xy(1, 3));

		
		add(panel3, cc.xy(1, 5));
		
	}
public void inserirNoticias(){ 
	this.noticiasRss = new PanelRss[3];
	
	this.noticiasRss[0] = new PanelRss();
	this.noticiasRss[0].labeltituloDaNoticia.setText("noticia1");
	this.noticiasRss[0].textPaneNoticias.setText("jkashgsakjhsjksa");
	add(this.noticiasRss[0], cc.xy(1, 1));
	
	this.noticiasRss[1] = new PanelRss();
	this.noticiasRss[1].labeltituloDaNoticia.setText("noticia2");
	this.noticiasRss[1].textPaneNoticias.setText("jkshklasjhsljkas");
	add(this.noticiasRss[1], cc.xy(1, 3));
	
	this.noticiasRss[2] = new PanelRss();
	this.noticiasRss[2].labeltituloDaNoticia.setText("noticia3");
	this.noticiasRss[2].textPaneNoticias.setText("jisuhgasdoiaghuisao");
	add(this.noticiasRss[2], cc.xy(1, 5));
}
	
	
}
